<%--
 *  File:    PriceListSummary.jsp
 *  @Author: Peter Shen
 *  Date:    Wednesday, October 16, 2002

 *  Copyright (C) 2000 - 2001 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>
 

<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<%@ page import="org.apache.log4j.Category" %>
<%@ page import="com.oval.util.*" %>

<%@ page contentType = "text/html;charset=UTF-8" %>
<%@ taglib uri="http://dcms.oval.com/page/dcms" prefix="dcms" %>
<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom" %>

<%
  Category cat = Category.getInstance("jsp.OrgSummary");
  String privilegeCode = "10101";
  String strModuleName = "OGM";
  String strTableName = "ovorg";
  String contextPath = request.getContextPath();
%>


<%@include file="/inc/PageDefault.inc"%>
<%@include file="/inc/FrmDefault.inc"%>
<%@include file="/inc/LocationDefault.inc"%>
<%@ include file="/inc/NewCalendar.inc" %>
<%@ include file="/rpt/ReportURL.inc"%>
<html>
<head>
<title></title>
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/<%= strLanguageCode %>/main.css" type="text/css">
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/<%= strLanguageCode %>/summary.css" type="text/css">
<LINK href="<%=request.getContextPath()%>/css/<%=strLanguageCode%>/main.htm" type=text/css>
<script language="JavaScript" src="<%=request.getContextPath() %>/js/ScriptLib.js"></script>
<script language="JavaScript" src="<%=contextPath %>/css/<%= strLanguageCode %>/script.js"></script>

<script language="JavaScript" src="<%=request.getContextPath() %>/js/Calendar.js"></script>
<script>
<%
HashMap CurUserInfo = (HashMap)session.getAttribute("userinfo");
Integer employeeid=(Integer)CurUserInfo.get("userid");
String  isadmin=(String)CurUserInfo.get("isadmin");
if(isadmin==null) isadmin="";
%>
function export_info(){
	
	//var searchvalue = document.employeename.value;
	//if(searchvalue=="" || searchvalue==null)searchvalue=-1;
	var employeename=document.__otherSearchConditionForm.employeename.value;
	//if(employeename=="" || employeename==null)employeename=-1;
	var __searchvalue;
	var obj=document.getElementById('__searchnamealias');
	var index =obj.selectedIndex;
	//var val = obj.options[index].text;
	var __searchname = obj.options[index].columnname;
	if(typeof (obj.options[index].type) != 'undefined'){
	  if(obj.options[index].type=='select'){
		
	  var 	obj1=document.getElementById("__searchvalue_selected");
	  var index1 =obj1.selectedIndex;
	   __searchvalue=obj1.options[index1].value;
	  }
	}else{
		__searchvalue=document.getElementById("__searchvalue").value
	}
	var url="";
	var pivot1=document.getElementById("pivot1").value;
	var pivot2=document.getElementById("pivot2").value;
	if(!isEmpty(__searchvalue)){
		<%if("Y".equals(isadmin)){%>
		     //window.open("<%= reportURL %>/servlet/ExcecuteReport/orgsummary.sox?__format=xlsx&__folder=/ovalreport&globalpccode=112&employeeid="+<%=employeeid %>+"&issalesman="+<%=CurUserInfo.get("issalesman") %>+"&employeename="+escape(encodeURI(employeename))+'&'+__searchname+'='+escape(encodeURI(__searchvalue)));
		     url="<%=newreportURL %>/xlsrpt?reportname=orgsummary&globalpccode=112&employeeid="+<%=employeeid %>+"&issalesman="+<%=CurUserInfo.get("issalesman") %>+"&employeename="+escape(encodeURI(employeename))+'&'+__searchname+'='+escape(encodeURI(__searchvalue));
		<%}else{%>
			//window.open("<%= reportURL %>/servlet/ExcecuteReport/orgsummary.sox?__format=xlsx&__folder=/ovalreport&globalpccode=112&employeeid="+<%=employeeid %>+"&employeeid2="+<%=employeeid %>+"&issalesman="+<%=CurUserInfo.get("issalesman") %>+"&employeename="+escape(encodeURI(employeename))+'&'+__searchname+'='+escape(encodeURI(__searchvalue)));
		    url="<%=newreportURL %>/xlsrpt?reportname=orgsummary&globalpccode=112&employeeid="+<%=employeeid %>+"&employeeid2="+<%=employeeid %>+"&issalesman="+<%=CurUserInfo.get("issalesman") %>+"&employeename="+escape(encodeURI(employeename))+'&'+__searchname+'='+escape(encodeURI(__searchvalue));
		<%}%>
	}else{
		<%if("Y".equals(isadmin)){%>
			//window.open("<%= reportURL %>/servlet/ExcecuteReport/orgsummary.sox?__format=xlsx&__folder=/ovalreport&globalpccode=112&employeeid="+<%=employeeid %>+"&issalesman="+<%=CurUserInfo.get("issalesman") %>+"&employeename="+escape(encodeURI(employeename)));
		    url="<%=newreportURL %>/xlsrpt?reportname=orgsummary&globalpccode=112&employeeid="+<%=employeeid %>+"&issalesman="+<%=CurUserInfo.get("issalesman") %>+"&employeename="+escape(encodeURI(employeename));
		<%}else{%>
			//window.open("<%= reportURL %>/servlet/ExcecuteReport/orgsummary.sox?__format=xlsx&__folder=/ovalreport&globalpccode=112&employeeid="+<%=employeeid %>+"&employeeid2="+<%=employeeid %>+"&issalesman="+<%=CurUserInfo.get("issalesman") %>+"&employeename="+escape(encodeURI(employeename)));
		    url="<%=newreportURL %>/xlsrpt?reportname=orgsummary&globalpccode=112&employeeid="+<%=employeeid %>+"&employeeid2="+<%=employeeid %>+"&issalesman="+<%=CurUserInfo.get("issalesman") %>+"&employeename="+escape(encodeURI(employeename));
		<%}%>
	}
	url=url+"&timestamp="+Date.parse(new Date())+"&datacategoryval=6";
	DataReport(url);
 
}

function export_batch(){
	
	//var searchvalue = document.employeename.value;
	//if(searchvalue=="" || searchvalue==null)searchvalue=-1;
	var employeename=document.__otherSearchConditionForm.employeename.value;
	//if(employeename=="" || employeename==null)employeename=-1;
	var __searchvalue;
	var obj=document.getElementById('__searchnamealias');
	var index =obj.selectedIndex;
	//var val = obj.options[index].text;
	var __searchname = obj.options[index].columnname;
	if(typeof (obj.options[index].type) != 'undefined'){
	  if(obj.options[index].type=='select'){
		
	  var 	obj1=document.getElementById("__searchvalue_selected");
	  var index1 =obj1.selectedIndex;
	   __searchvalue=obj1.options[index1].value;
	  }
	}else{
		__searchvalue=document.getElementById("__searchvalue").value
	}
	if(!isEmpty(__searchvalue)){
		<%if("Y".equals(isadmin)){%>
		     window.open("<%= reportURL %>/servlet/ExcecuteReport/batchorg112.sox?__format=xlsx&__folder=/ovalreport&globalpccode=112&employeeid="+<%=employeeid %>+"&issalesman="+<%=CurUserInfo.get("issalesman") %>+"&employeename="+escape(encodeURI(employeename))+'&'+__searchname+'='+escape(encodeURI(__searchvalue)));
		<%}else{%>
			window.open("<%= reportURL %>/servlet/ExcecuteReport/batchorg112.sox?__format=xlsx&__folder=/ovalreport&globalpccode=112&employeeid="+<%=employeeid %>+"&employeeid2="+<%=employeeid %>+"&issalesman="+<%=CurUserInfo.get("issalesman") %>+"&employeename="+escape(encodeURI(employeename))+'&'+__searchname+'='+escape(encodeURI(__searchvalue)));
		<%}%>
	}else{
		<%if("Y".equals(isadmin)){%>
			window.open("<%= reportURL %>/servlet/ExcecuteReport/batchorg112.sox?__format=xlsx&__folder=/ovalreport&globalpccode=112&employeeid="+<%=employeeid %>+"&issalesman="+<%=CurUserInfo.get("issalesman") %>+"&employeename="+escape(encodeURI(employeename)));
		<%}else{%>
			window.open("<%= reportURL %>/servlet/ExcecuteReport/batchorg112.sox?__format=xlsx&__folder=/ovalreport&globalpccode=112&employeeid="+<%=employeeid %>+"&employeeid2="+<%=employeeid %>+"&issalesman="+<%=CurUserInfo.get("issalesman") %>+"&employeename="+escape(encodeURI(employeename)));
		<%}%>
	}
 
}

function export_orggrade(){
    var employeename=document.__otherSearchConditionForm.employeename.value;
    var __searchvalue;
	var obj=document.getElementById('__searchnamealias');
	var index =obj.selectedIndex;
	var __searchname = obj.options[index].columnname;
	if(typeof (obj.options[index].type) != 'undefined'){
	  if(obj.options[index].type=='select'){
		
	  var 	obj1=document.getElementById("__searchvalue_selected");
	  var index1 =obj1.selectedIndex;
	   __searchvalue=obj1.options[index1].value;
	  }
	}else{
		__searchvalue=document.getElementById("__searchvalue").value
	}
	var url="";
	if(!isEmpty(__searchvalue)){
	 <%if("Y".equals(isadmin)){%>
       //window.open("<%= reportURL %>/servlet/ExcecuteReport/orggradeupload.sox?__format=xlsx&__folder=/ovalreport&employeename="+escape(encodeURI(employeename))+'&'+__searchname+'='+escape(encodeURI(__searchvalue)));
       url="<%=newreportURL %>/xlsrpt?reportname=orggradeupload&employeename="+escape(encodeURI(employeename))+'&'+__searchname+'='+escape(encodeURI(__searchvalue));
     <%}else{%>
       //window.open("<%= reportURL %>/servlet/ExcecuteReport/orggradeupload.sox?__format=xlsx&__folder=/ovalreport&employeeid="+<%=employeeid %>+"&employeename="+escape(encodeURI(employeename))+'&'+__searchname+'='+escape(encodeURI(__searchvalue)));
       url="<%=newreportURL %>/xlsrpt?reportname=orggradeupload&employeeid="+<%=employeeid %>+"&employeename="+escape(encodeURI(employeename))+'&'+__searchname+'='+escape(encodeURI(__searchvalue));
     <%}%>
     }else{
     <%if("Y".equals(isadmin)){%>
      //window.open("<%= reportURL %>/servlet/ExcecuteReport/orggradeupload.sox?__format=xlsx&__folder=/ovalreport&employeename="+escape(encodeURI(employeename)));
      url="<%=newreportURL %>/xlsrpt?reportname=orggradeupload&employeename="+escape(encodeURI(employeename));
     <%}else{%>
      //window.open("<%= reportURL %>/servlet/ExcecuteReport/orggradeupload.sox?__format=xlsx&__folder=/ovalreport&employeeid="+<%=employeeid %>+"&employeename="+escape(encodeURI(employeename)));
      url="<%=newreportURL %>/xlsrpt?reportname=orggradeupload&employeeid="+<%=employeeid %>+"&employeename="+escape(encodeURI(employeename));
      <%}%>
     }
	 url=url+"&timestamp="+Date.parse(new Date())+"&datacategoryval=10,16";
	 DataReport(url);
}
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<%
String str1 = label.getLabelName("L_BasicInfo");
String str2=label.getLabelName("L_LinkMan1");
String str = label.getLabelName("L_ThreeRelationship");
String str3=label.getLabelName("L_PriceInfo");
String str4=label.getLabelName("L_AttrInfo");
%>

<dcms:summary id="ogm.zylreportorgsummary" summaryDataName="orgsummary" needNew="true" newTabID="mainTab" needEdit="true" editTabID="mainTab">


 <dcms:param name="userid" property="session:userinfo.userid"/> 
 <dcms:param name="pivot1" property="pivotinfo1.pivot1"/>
 <dcms:param name="pivot2" property="pivotinfo1.pivot2"/>
 <dcms:summaryTab id="mainTab" name="<%=str1 %>"  href="/masterdata/ogm/OrgEdit.jsp"/>
 <dcms:summaryTab id="attributeTab" name="<%=str%>"  href="/zyl/masterdata/erm/ZylMasterdataRelationship.jsp?globalpccode=112"/>
 <dcms:summaryTab id="attTab" name="<%=str4 %>"  href="/masterdata/ogm/OrgEditOther.jsp"/>
 <%--<dcms:summaryTab id="linkmanTab" name="<%=str2%>"  href="/zyl/masterdata/ogm/DTKeyPerson.jsp"/>--%>
 <dcms:summaryTab id="priceTab" name="<%=str3%>"  href="/masterdata/ogm/ZylOrgPriceInfo.jsp"/>
 <dcms:summaryAction actionFuction="__export('XLSXQ')" labelCode="L_ALL_Execcd" styleWidth="70" privilegeCode="MB-JXS03"/>
 <dcms:summaryAction actionFuction="export_info" labelCode="L_Upload_Derived" styleWidth="77" privilegeCode="MB-JXS04"/>
 <dcms:summaryAction actionFuction="export_orggrade" labelCode="L_CustomerLevelExport" styleWidth="120" privilegeCode="MB-JXS05"/>
 <dcms:summaryAction actionFuction="export_batch" labelCode="L_CustomerBatchExport" styleWidth="120" privilegeCode="MB-JXS06"/>
  <dcms:otherSearchCondition>
   <iframe id="reloadHandler" name="reloadHandler" style="display:none"></iframe>
     <table width="100%" cellspacing="0" cellpadding="0" border="0">
     <tr style="text-align:left"><td style="text-align:left"><%= label.getLabelName("L_EmployeeName") + label.getLabelName("L_Colon") %>
             <custom:text  property="employeename" size="30"/>
              </td>
			</tr>
        </table>
  </dcms:otherSearchCondition>  
</dcms:summary>

</body>
<script>
  document.getElementById("__searchvalue").onkeydown=function seachKeyDown()
  {
   // alert(event.keyCode);
    if(event.keyCode==13)
    {
      __summaryGo(document.getElementById("__summaryConfigID").value,document.getElementById("__indicatorImagePath").value,document.getElementById("__summaryRootPath").value,'');
    }
  }
</script> 
</html>